<extend name="Index:base" />
<block name="title"><title>店铺管理</title></block>
<block name="style">
 <style>
.main,.panel-default>.panel-heading{
background:none;
}
body{
background:none;
}
.panel.panel-default,.panel .panel-body,.panel .panel-heading,.table-bordered {
	border:none;
}
.table-bordered > thead > tr > th, .table-bordered > tbody > tr > th, .table-bordered > tfoot > tr > th, .table-bordered > thead > tr > td, .table-bordered > tbody > tr > td, .table-bordered > tfoot > tr > td {
	border:none;		
	padding:15px;	
	line-height:8px;
	height: 8px;
	border-top: 1px solid #d4d4d4;
	border-bottom: 1px solid #d4d4d4;
}
.name strong{
color:#000000;
font-size:15px;
font-weight:600;
}
.name {
	color:#20a8d8;
	font-size:12px;
}
.smallfont {
	color:#9c9c9c;
	font-size:12px;
}

.align-center{
	text-align:center; 
}
.title2{
text-align:center;
}
.table-bordered > tbody > tr .wd{
	text-align:left;	
}

.col-xs-2,.col-xs-4{
padding-right:0;
margin:10px 0;
}
.col-sm-3{
width:10%;
}
.col-sm-2{
width:8%;
}
.col-sm-1{
width:5%;
}
.col-sm-4{
width:18%;
}
.col-sm-1,.col-sm-2{
margin:16px 0;
}
.col-sm-3,.col-sm-4{
margin:10px 0;
}
.col-sm-1,.col-sm-2,.col-sm-3,.col-sm-4{
padding-right:0;
}
 </style>
</block>
<!-- start: Header -->
<block name="body">
	<div class="main ">
		<div class="row">
			<div class="col-lg-12">
				<h3 class="page-header"><i class="fa fa-life-bouy"></i>首页分区</h3>
			</div>
		</div>
		
		<div class="row">
			<div class="col-lg-12">
				<div class="panel panel-default">
					<div class="panel-heading">
						<h2><span class="break"></span><strong>首页分区</strong></h2>
					</div>&nbsp;&nbsp;&nbsp;
					<ol class="breadcrumb" style="height:55px;background-color: #ffffff;">							
						<li><i class="fa fa-warning"></i><a href="#">操作提示：</a></li><br/>	
						<li><font style="font-size:8px;color:#888;">XXXXXX</font></li>							
					</ol>
					
					<div class="panel-body">
						<table class="table table-striped table-bordered bootstrap-datatable datatable">
							<thead>
								<tr>
									<th>排序</th>
									<th></th>
									<th>区域名称</th>
									<th></th>
									<th>区域地址</th>
									<th></th>
									<th class="title2">操作</th>
								</tr>
							</thead>
							<tbody id="state">
								<foreach name="list" item="vo">
								<tr>
									<td>{$vo.shop_area_sort}<td>
									<td>{$vo.shop_area_name}<td>
									<td>{$vo.shop_area_href}<td>
									<td class="align-center">
										<a class="label label-primary" role="button" data-toggle="modal" href="#edit" data-id="{$vo.shop_area_id}" data-sort="{$vo.shop_area_sort}" data-name="{$vo.shop_area_name}" data-href="{$vo.shop_area_href}" data-state="{$vo.shop_area_state}">编辑</i>
										</a>
										<if condition="$vo.shop_area_state eq '1'">
										<span class="label label-success" data-status="1" >开启</span>
										</if>
										<if condition="$vo.shop_area_state eq '0'">
										<span class="label label-danger" data-status="0" >关闭</span>
										</if>
									</td>
								</tr>
								</foreach>
							</tbody>
						</table>
					</div>
				</div>
			</div>
		</div>
	</div>
	
	<div aria-hidden="true" aria-labelledby="myModalLabel" role="dialog" tabindex="-1" id="modal" class="modal fade add_right">
		<div class="modal-dialog public-top">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
					<h4 class="modal-title" id="title">编辑首页分区</h4>
				</div>
				<form action="{:U('Store/area')}" method="post" class="form-horizontal" id="action">
					<div class="modal-body">
						<label><font style="color:red;">*</font>区域排序:</label>
						<div>
							<input type="text" id="shop_area_sort" name="shop_area_sort" value="" class="form-control placeholder-no-fix" placeholder="必填">
						</div></br>
						
						<label><font style="color:red;">*</font>区域名称:</label>
						<div>
							<input type="text" id="shop_area_name" name="shop_area_name" value="" class="form-control placeholder-no-fix" placeholder="必填">
						</div></br>
						
						<label><font style="color:red;">*</font>区域地址:</label>
						<div>
							<input type="text" id="shop_area_href" name="shop_area_href" value="" class="form-control placeholder-no-fix" placeholder="必填">
						</div></br>
						
						<label><font style="color:red;">*</font>是否开启:</label>
						<div>
							<label><input type="radio" name="shop_area_state" value="1" />开启</label>
							<label><input type="radio" name="shop_area_state" value="0" />关闭</label>
						</div></br>
						<input type="hidden"  name="shop_area_id" id="shop_area_id" value="">
					</div>
					<div class="modal-footer">
						<button data-dismiss="modal" class="btn btn-default" type="button">关闭</button>
						<button class="btn btn-primary mypost" type="sunmit">确认</button>
					</div>
				</form>
			</div>
		</div>
	</div>
</block>
<block name="script">
<script>
	$("#state tr td a").click(function(){
		$('#modal').modal();
		var _this = $(this);
		var shop_area_id = _this.attr('data-id');
		var shop_area_sort = _this.attr('data-sort');
		var shop_area_name = _this.attr('data-name');
		var shop_area_href = _this.attr('data-href');
		var shop_area_state = _this.attr('data-state');
		$('#shop_area_id').val(shop_area_id);
		$('#shop_area_sort').val(shop_area_sort);
		$('#shop_area_name').val(shop_area_name);
		$('#shop_area_href').val(shop_area_href);
		$('input[name="shop_area_state"][value=' + shop_area_state +']').attr("checked",true);
	});
</script>
</block>